﻿using System;
using System.ComponentModel.DataAnnotations;

namespace Management.Core.Team
{
    /// <summary>
    /// 班组
    /// </summary>
    public class Team
    {
        [Key]
        public int TeamID { get; set; }

        /// <summary>
        /// 班组名称
        /// </summary>
        [Required(ErrorMessage="必填")]
        [Display(Name="班组名称")]
        public string Name { get; set; }

        /// <summary>
        /// 组长
        /// </summary>
        [Required(ErrorMessage = "必填")]
        [Display(Name = "组长")]
        public string Leader { get; set; }

        /// <summary>
        /// 人数
        /// </summary>
        [Required(ErrorMessage = "必填")]
        [Display(Name = "人数")]
        public int Number { get; set; }
        
        /// <summary>
        /// 车间编号
        /// </summary>
        [Required(ErrorMessage = "必填")]
        [Display(Name = "车间编号")]
        public int WorkshopID { get; set; }

        /// <summary>
        /// 部门编号
        /// </summary>
        [Required(ErrorMessage = "必填")]
        [Display(Name = "部门编号")]
        public int DepartmentID { get; set; }

        /// <summary>
        /// 工序编号
        /// </summary>
        [Required(ErrorMessage = "必填")]
        [Display(Name = "工序编号")]
        public int ProcessID { get; set; }

        /// <summary>
        /// 制造部编号
        /// </summary>
        [Required(ErrorMessage = "必填")]
        [Display(Name = "制造部编号")]
        public int ManufacturingID { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Required(ErrorMessage = "必填")]
        [Display(Name = "创建时间")]
        public DateTime Created_at { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        [Required(ErrorMessage = "必填")]
        [Display(Name = "更新时间")]
        public DateTime Updated_at { get; set; }

        public virtual Workshop.Workshop Workshop { get; set; }
    }
}
